<?php
echo "rendezvs";

echo "</br>";
$dossier = 0 ;
$count=  0 ;
						
$SQL="SELECT
Count(cabinet_rendezvous.dossierId) as count,
cabinet_rendezvous.dossierId,
cabinet_rendezvous.prochainrendezvous,
cabinet_rendezvous.date AS rndvdate,
cabinet_soins.date AS soindate,
cabinet_soins.id AS soinid
FROM
cabinet_rendezvous
INNER JOIN cabinet_soins ON cabinet_rendezvous.date = cabinet_soins.date AND cabinet_soins.dossierId = cabinet_rendezvous.dossierId
WHERE
cabinet_soins.dossierId = 25";

$rs=ew_LoadRecordset($SQL);
if ($rs && !$rs->EOF){ 
						$count=$rs->fields['count'];
						$soinID=$rs->fields['soinid'];
					}
	echo  "count".$count ;
	echo  "soinID".$soinID.$currentObject->id ;
					
if ($count > 0 &&  $soinID == $currentObject->id ){
   echo  "prochainrendezvous".$rs->fields['prochainrendezvous'] ; 
   echo  "donne le".$rs->fields['rndvdate'] ;
   echo  "soindate".$rs->fields['soindate'] ;
   echo   $currentObject->id ;
   }
   
   
 ?>	